# syntax=docker/dockerfile:1.4
# vim: ft=dockerfile

FROM {{ base_image }}:{{ base_image_tag }}

{% if disable_cache_mounts %}
RUN \
{% else %}
RUN --mount=type=cache,target=/var/cache/apt \
{% endif %}
    apt-get update && \
    apt-get -y install --no-install-recommends \
    nginx

ENV GIT_HASH={{ git_hash }}
ENV GIT_SHORT_HASH={{ git_short_hash }}
ENV GIT_BRANCH={{ git_branch }}

COPY docker/nginx/nginx.{{ environment }}.conf /etc/nginx/sites-enabled/
RUN rm -f /etc/nginx/sites-enabled/default

CMD ["nginx", "-g", "daemon off;"]

